/**
 * DiggApiNet - Digg API .NET Wrapper
 * 
 * Author: Sean Hickey
 * Link: http://www.headzoo.com/digg_api_net
 * License: GPL v2 ( http://www.gnu.org/licenses/gpl.txt )
 */
using System;
using System.Collections;
using System.Text;
using System.Web;

namespace DiggApiNet
{
    public partial class DiggApi
    {
        public class ListUsers : DiggApi
        {
            private const string get_all            = "http://services.digg.com/users/{0}";
            private const string get_by_username    = "http://services.digg.com/user/{0}/{1}";
            private const string get_friends        = "http://services.digg.com/user/{0}/friends/{1}";
            private const string get_fans           = "http://services.digg.com/user/{0}/fans/{1}";

            public DiggUsers GetAll()
            {
                return GetAll(new Hashtable());
            }
            public DiggUsers GetAll(Hashtable args)
            {
                string uri = String.Format(get_all, HttpBuildUrl(args));
                return new DiggUsers(Request(uri));
            }

            public DiggUser GetByUsername(string username)
            {
                return GetByUsername(username, new Hashtable());
            }
            public DiggUser GetByUsername(string username, Hashtable args)
            {
                string uri = String.Format(get_by_username, username, HttpBuildUrl(args));
                return new DiggUser(Request(uri));
            }

            public DiggUsers GetFriends(string username)
            {
                return GetFriends(username, new Hashtable());
            }
            public DiggUsers GetFriends(string username, Hashtable args)
            {
                string uri = String.Format(get_friends, username, HttpBuildUrl(args));
                return new DiggUsers(Request(uri));
            }

            public DiggUsers GetFans(string username)
            {
                return GetFans(username, new Hashtable());
            }
            public DiggUsers GetFans(string username, Hashtable args)
            {
                string uri = String.Format(get_fans, username, HttpBuildUrl(args));
                return new DiggUsers(Request(uri));
            }
        }
    }
}
